
//
//  orderFinishViewController.m
//  YuErmuYing
//
//  Created by Tiancheng on 16/8/19.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "orderFinishViewController.h"
#import "HttpRequest.h"
#import "yueSao01.h"
#import "NSString+NSDateToNSString.h"
#import "yueShaoOrderFinish.h"
#import "orderFinish.h"

@interface orderFinishViewController ()
@property (weak, nonatomic) IBOutlet UIView *headerView;
//更改订单字体颜色
@property (weak, nonatomic) IBOutlet UILabel *orderLabel;
@property (weak, nonatomic) IBOutlet UILabel *orderPeopleLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateTimeLabel;
@property (weak, nonatomic) IBOutlet UIButton *goBackBtn;
//夺宝成功时，要修改的数据
@property (weak, nonatomic) IBOutlet UILabel *orderDetailLabel;
//谁定的单
@property (weak, nonatomic) IBOutlet UILabel *orderPersonLabel;

//从服务器获取的数组
@property(nonatomic,copy)NSMutableArray *json_Array1;
@end

@implementation orderFinishViewController
@synthesize json_Array1;
-(void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden=YES;
    self.tabBarController.tabBar.hidden=YES;
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.headerView.backgroundColor=[UIColor colorWithRed:244/255.0 green:143/255.0 blue:177/255.0 alpha:1.0];
    [self.goBackBtn setBackgroundColor:[UIColor colorWithRed:244/255.0 green:143/255.0 blue:177/255.0 alpha:1.0]];

    self.view.backgroundColor=[UIColor colorWithRed:243/255.0 green:243/255.0 blue:243/255.0 alpha:1.0];
    self.orderLabel.textColor=[UIColor colorWithRed:136/255.0 green:14/255.0 blue:79/255.0 alpha:1.0];
    orderFinish *of=[orderFinish sharedManager];
    if (of.isTrue==1)
    {
        self.orderLabel.text=@"夺宝成功";
        self.orderPersonLabel.text=@"本单金额:";
        self.orderDetailLabel.text=@"您的夺宝已经预定成功";
//        of.moneyString;
//        of.timeString
        self.orderPersonLabel.text=@"夺宝金额:";
        self.orderPeopleLabel.text=[NSString stringWithFormat:@"%@元",of.moneyString];
        self.dateTimeLabel.text=of.timeString;
    }
    else
    {
        [self changeValue];
    }
    of.isTrue=1;
    
}
-(void)changeValue
{
    yueShaoOrderFinish *ysof=[yueShaoOrderFinish shardeManager];
    self.orderPeopleLabel.text=ysof.username;
    self.dateTimeLabel.text=[NSString StringNSDateToNSString:ysof.time];

}

//返回首页
- (IBAction)goBack:(id)sender
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
